#include <iostream>
#include <algorithm>

using namespace std;

int *arr;

int main(int argc, char const *argv[])
{
    int n, m;
    int i;
    cin >> n >> m;
    arr = new int[m];
    for (i = 0; i < m; i++)
    {
        cin >> arr[i];
    }
    sort(arr, arr + m);
    for (i = 0; i < m; i++)
    {
        if (i) cout << " ";
        cout << arr[i];
    }
    
    return 0;
}
